window.addEventListener("DOMContentLoaded", function() {
	let lookMoreDiv = document.getElementsByClassName("look-more")[0];
	let containMoreInfo = document.getElementById("contain-more-info");
	lookMoreDiv.flag = false;
	lookMoreDiv.addEventListener("click", function() {
		this.flag = !this.flag;
		if(this.flag) {
			containMoreInfo.style.left = "0";
			return;
		}
		containMoreInfo.style.left = "-100%";

	});
	jQuery.noConflict();
	jQuery(function($) {
		$("#lookWeather .hide-div").click(function() {
			$("#lookWeather").stop(true).toggle(300);
		});
		$("#toggle-div").click(function() {
			$("#header-div1 >div:first ~ div").stop(true).fadeToggle(300);
			
		});
		$("#header-div1 > div:eq(1)").click(function() {
			$("#lookWeather").stop(true).toggle(300);
			$(".title").stop(true).toggle(300); // 记得：jQuery的动画效果、函数要加上节流阀，防抖操作 stop(true)
			//alert(123);
		});
		let showOrHideEchartsDiv = null;
		$("#click-show-temperature-chart").click(showOrHideEchartsDiv = function() {
			$("#con-father-div").stop(true).slideToggle(300);
			
		});
		$("#con-father-div > div:last-child").click(function() {
			$("#con-father-div").stop(true).slideUp(300);
		});
		/*$(window).scroll(function() {
			let windowScroll = $(this).scrollTop();
			if((windowScroll + window.innerHeight) >= $("#character-description").offset().top) {
				
				$(".three-cascade-img-div >img").eq(1).stop(true).fadeIn(300).next("img").stop(true).fadeIn(300);
				console.log(666);
				return;
			}
			$(".three-cascade-img-div >img").eq(1).stop(true).fadeOut(300).next("img").stop(true).fadeOut(300);
			console.log(888);
		});*/
		$("#character-description").get(0).count = 1;
		$("#character-description").click(function() {
			/*this.count++;*/
			if(this.count % 2 !== 0) {
				this.count--;
				$(".three-cascade-img-div >img").eq(1).stop(true).delay(100).stop(true).fadeIn(500).next("img").stop(true).delay(200).stop(true).fadeIn(500);
				console.log(666);
				return;
			}
			this.count++;
			$(".three-cascade-img-div >img").eq(1).stop(true).delay(200).stop(true).fadeOut(500).next("img").stop(true).delay(100).stop(true).fadeOut(500);
			console.log(888);
		});
		// 在indexSection.css文件中设置了这个大盒子的pointer-events 样式为none，防止用户多次快速点击，防止造成定时器与click事件重复执行
		setInterval(function() {
			$("#character-description").click();
			
		}, 5000);
	});
});